import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.text.ParseException;

import controller.LoginController;

import cmms.CMMS;

@SuppressWarnings("unused")
public class ProgramManager {
	public static void main(String[] args) throws IOException, NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException, ParseException, InvocationTargetException, NoSuchMethodException {
		LoginController login = new LoginController();

		int i = 4;
		while (!login.isLogged() && i > 0) {
			if(login.getStaffList().getFirstNode()!=null){
				login.login();
				i--;
			} else {
				i=-1;
			}
		}

		if (i > 0) {
			CMMS sys = new CMMS(login.getStaff());
		} else {
			System.out.println("Unsuccessful Login, CMMS terminated.");
		}
	}
}